home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / japan.pxl < prev    next >
Text File  |  2000-04-03  |  23KB  |  837 lines

  1.      UseCoordinates(PIXEL)
  2.     UseFont("Arial",5,15,NOBOLD,NOITALIC,NOUNDERLINE,0,0,255)
  3.  
  4.     SetColorPalette(BITMAP)
  5.     
  6.     WinGetActive(Win$)
  7.     Title$ = "Main Display Window"
  8.     UseCaption(Title$)
  9.     WinLocate(Title$,10,20,770,540,Res)
  10.     WinShow(Title$,NOTOPMOST,Res)
  11.     UseBackground(TRANSPARENT,192,192,192)
  12.     DrawBackground
  13.     DirGet(SourceDir$)
  14.     Scene1$ = SourceDir$ + "\furfcomp.bmp"
  15.     Scene2$ = SourceDir$ + "\furtclas.bmp"
  16.     WorkbenchTitle$ = "RSI Workbench Simulation"
  17.     ShowGrid = 0
  18.     Chr(12,CR$) 
  19.     Chr(10,LF$) 
  20.     CRLF$ = CR$ + LF$ 
  21.     Chr(9,TAB$)
  22.     PenSize = 1
  23.     PenR = 0
  24.     PenG = 0
  25.     PenB = 0
  26.  
  27.  
  28.     InfoMenu(REMOVE)
  29.     WaitInput(100)
  30.     GoSub MainFrameMenu
  31.     GoSub Initial_Help
  32.  
  33. Wait_for_Input:
  34.     WaitInput()
  35.  
  36. Leave:
  37.     GoSub CloseAllWorkbenches
  38.     End
  39.  
  40. MapTitle:
  41.     Label$ = "Current Map Title"
  42.     MapTitle$ = "Furano City, Hokkaido"
  43.     Text$ ="Enter the required map title, set the font, and then click in the image to set the title position."
  44.     TextBox(Text$,Label$,MapTitle$,Btn)
  45.     If Btn = 2 Then Goto Wait_for_Input
  46.     W = 0 H = 0 R = 0 G = 0 B = 0
  47.     ChooseFont(Font$,W,H,R,G,B, Bold, Ital,Undl,Strike)
  48.     UseFontExt(Font$,W,H,Bold, Ital,Undl,Strike, R,G,B)
  49.     UseCursor(CROSS)
  50.     SetMouse(10,40,Pixels,Lines,MouseTitle,qX,qY)
  51.     WaitInput()
  52. MouseTitle:
  53.     DrawText(qX,qY, MapTitle$)
  54.     UseCursor(ARROW)
  55.     SetMouse(10,40,Pixels,Lines,PopupOpsFill,LX,LY)
  56.     Goto Wait_for_Input
  57.  
  58.  
  59. FireWorkbench:
  60.     Filter$ = "Workbench Files (*.wbh),*.wbh"
  61.     InitFile$ = "*.wbh"
  62.     InitDir$ = SourceDir$
  63.     Label$ = "Select a Workbench file to open"
  64.     FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
  65.     If Name$ = "" Then Goto Wait_for_Input
  66.  
  67.     CmdLine$ = "PiXCL44 wrkbnch1.pxl"
  68.     Run(CmdLine$)
  69.     DrawStatusWinText(1,Name$)
  70.     Goto Wait_for_Input
  71.  
  72. Floodworkbench:
  73.     Filter$ = "Workbench Files (*.wbh),*.wbh"
  74.     InitFile$ = "*.wbh"
  75.     InitDir$ = SourceDir$
  76.     Label$ = "Select a Workbench file to open"
  77.     FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
  78.     If Name$ = "" Then Goto Wait_for_Input
  79.  
  80.     CmdLine$ = "PiXCL44 wrkbnch2.pxl"
  81.     Run(CmdLine$)
  82.     DrawStatusWinText(1,Name$)
  83.     Goto Wait_for_Input
  84.  
  85. TransportWorkbench:
  86.     Filter$ = "Workbench Files (*.wbh),*.wbh"
  87.     InitFile$ = "*.wbh"
  88.     InitDir$ = SourceDir$
  89.     Label$ = "Select a Workbench file to open"
  90.     FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
  91.     If Name$ = "" Then Goto Wait_for_Input
  92.  
  93.     CmdLine$ = "PiXCL44 wrkbnch3.pxl"
  94.     Run(CmdLine$)
  95.     DrawStatusWinText(1,Name$)
  96.     Goto Wait_for_Input
  97.  
  98.  
  99.  
  100. PopupContext:
  101. Demo:
  102.     MessageBox(OK,1,INFORMATION,"Function not implemented in this sample program.","PiXCL 4.4 Demo",Res)
  103.     Goto Wait_for_Input
  104.  
  105. ImportOverlayDemo:
  106.     SetMouse()
  107.     SetRightMouse()
  108.     LoadBitmap(Scene2$,FULL)
  109.     DrawBitmap(10,40,Scene1$)
  110.     OverlayImage(Scene2$,0,0,0,Res)
  111.     DrawBitmap(10,40,Scene1$)
  112.     GetBitmapDim(Scene1$,Lines,Pixels,Bits)
  113.     DrawStatusWinText(1,"Overlay#1 loaded")
  114.     Lines +=40
  115.     Pixels +=10
  116.     Goto Wait_for_Input
  117.  
  118.  
  119. NewDemo:
  120.     GoSub ApplicationFrameMenu
  121.     GoSub Create_ToolWindow
  122.     DrawBitmap(10,40,Scene1$)
  123.     GetBitmapDim(Scene1$,Lines,Pixels,Bits)
  124.     Lines +=40
  125.     Pixels +=10
  126.     Goto Wait_for_Input
  127.  
  128.  
  129. PopupOps:
  130.     GetPixel(rX,rY,mR,mG,mB,Res)
  131.     ChooseColor(STD,Red,Green,Blue)
  132.     UseBrush(SOLID,Red,Green,Blue)
  133.     DrawFloodExt(rX,rY,mR,mG,mB,SURFACE)
  134.     SetMouse(10,40,Pixels,Lines,PopupOpsFill,LX,LY)
  135.     Goto Wait_for_Input
  136.  
  137.  
  138. PopupOpsEdit:
  139.     GetMenuStatus("Edit Overlay Color",CHECKED,OverlayEditEnabled)
  140.     If OverlayEditEnabled = 0 {so enable overlay edit operations with mouse} 
  141.         SetRightMouse(10,40,Pixels,Lines,PopupOps,rX,rY)
  142.         SetDrawMouse(BOTH)
  143.         ChangeMenuItem("Edit Overlay Color",CHECK,Res)
  144.     Endif
  145.     If OverlayEditEnabled = 0 Then Goto PopUpOpsFill
  146.  
  147.     If OverlayEditEnabled = 1 {turn off overlay edit operations}
  148.         ChangeMenuItem("Edit Overlay Color",UNCHECK,Res)
  149.         UseBrush(SOLID,255,255,255)
  150.     Endif
  151.     If OverlayEditEnabled = 1 Then Goto PopUpOpsFillEnd
  152.  
  153. PopupOpsFill:
  154.     GetPixel(LX,LY,mR,mG,mB,Res)
  155.     DrawFloodExt(LX,LY,mR,mG,mB,SURFACE)
  156.     Goto Wait_for_Input
  157.  
  158. PopupOpsFillEnd:
  159.     SetDrawMouse(DISABLE)
  160.     SetMouse()
  161.     SetRightMouse()
  162.     SetShftMouse()
  163.     Goto Wait_for_Input
  164.  
  165. DeleteOverlayDemo:
  166.     SetMouse()
  167.     SetRightMouse()
  168.     DrawBitmap(10,40,Scene1$)
  169.     DrawStatusWinText(1,"")
  170.     Goto Wait_for_Input
  171.  
  172. DrawGrid:
  173.     UsePen(SOLID,1,0,0,0)
  174.     {10,40,Pixels,Lines   are the image display coords}
  175.     For i=10 To Pixels By 40
  176.         If i > Pixels Then Break
  177.         DrawLine(i,40,i,Lines)
  178.     Next
  179.     For i=40 To Lines By 40
  180.         If i > Lines Then Break
  181.         DrawLine(10,i,Pixels,i)
  182.     Next
  183.     Goto Wait_for_Input
  184.  
  185.  
  186. OpenImage:
  187.     GoSub MakeFilter
  188.     InitFile$ = "*.bmp"
  189.     InitDir$ = SourceDir$
  190.     Label$ = "Open an image for display"
  191.     WaitInput(1) {let windows catch up}
  192.     FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
  193.     If Name$ = "" Then Goto Wait_for_Input
  194.     GoSub ApplicationFrameMenu
  195.     GoSub Create_Toolwindow
  196.  
  197.     FreeBitmap(Name$) {just in case its loaded}
  198.     ImageWindow1$ = "ImageWindow#1: " + Name$
  199.     DrawBitmap(10,40,Name$)
  200.     DrawStatusWinText(0,"Base image loaded.")
  201.     GetBitmapDim(Scene1$,Lines,Pixels,Bits)
  202.     Lines +=40
  203.     Pixels +=10
  204.     SetRightMouse(10,40,Pixels,Lines,PopupOps,rX,rY)
  205.     SetMouse(10,40,Pixels,Lines,PopupOpsFill,LX,LY)
  206.     Goto Wait_for_Input
  207.     
  208. CloseImage:
  209.     GoSub MakeFilter
  210.     InitFile$ = "*.bmp"
  211.     InitDir$ = SourceDir$
  212.     Label$ = "Save the current image"
  213.     WaitInput(1) {let windows catch up}
  214.     FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
  215.     If Name$ = "" Then Goto Wait_for_Input
  216.     GoSub MainFrameMenu
  217.     ToolWindow()
  218.     DrawStatusWinText(0,"No image loaded.")
  219.     Goto Wait_for_Input
  220.  
  221. OpenWBH:
  222.     Filter$ = "Workbench Files (*.wbh),*.wbh"
  223.     InitFile$ = "*.wbh"
  224.     InitDir$ = SourceDir$
  225.     Label$ = "Select a Workbench file to open"
  226.     FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
  227.     If Name$ = "" Then Goto Wait_for_Input
  228.     GoSub ApplicationFrameMenu
  229.     DrawBitmap(10,40,Scene1$)
  230.  
  231.     CmdLine$ = "PiXCL41 workbench1.pxl"
  232.     Run(CmdLine$)
  233.     DrawStatusWinText(1,Name$)
  234.     Goto Wait_for_Input
  235.     
  236. CloseWBH:
  237.     Filter$ = "Workbench Files (*.wbh),*.wbh"
  238.     InitFile$ = "*.wbh"
  239.     InitDir$ = SourceDir$
  240.     Label$ = "Save the current Workbench"
  241.     FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
  242.     If Name$ = "" Then Goto Wait_for_Input
  243.     GoSub MainFrameMenu
  244.     ToolWindow()
  245.     ToolWindowView = 0
  246.     GoSub CloseAllWorkbenches
  247.     Goto Wait_for_Input
  248.  
  249. About:
  250.     AboutUser("About ...","Interface Design Simulation",
  251. "This program demonstrates user interface and image display options using PiXCL.")
  252.     Goto Wait_for_Input
  253.     
  254. ColorTable:
  255.     CustomColor(255,0,0,  0,255,0,  0,0,255,  255,255,0,
  256.         0,255,0,  0,255,255, 192,192,192, 255,160,0,
  257.         160,255,0, 0,255,160, 0,0,255,     255,255,0,
  258.         0,255,0, 0,255,255, 255,255,255, 255,255,255)
  259.  
  260.     Red = 255 Green = 0 Blue = 255
  261.     ChooseColor(STD,Red,Green,Blue)
  262.     Goto Wait_for_Input
  263.  
  264.  
  265. BrowseDemoR:
  266.     GoSub MakeFilter
  267.     InitDir$ = SourceDir$
  268.     InitFile$ = ""
  269.     Label$ = "Select an image file"
  270.     FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Image$)
  271.     If Image$ = "" Then Goto Wait_for_Input
  272.  
  273.     Text$ = 
  274. "Text that appears in the imagebox,
  275. would list known information about
  276. the selected image. This could be
  277. metadata embedded in the file
  278. e.g. in geoTIFF, or data from an
  279. external file or database access."
  280.  
  281.     ImageBox("Browse Raster Images",Image$, Text$,
  282.         "&Button#1", "&More Info",Btn)
  283.     FreeBitMap(Image$)
  284.     
  285.     Goto Wait_for_Input
  286.  
  287. BrowseDemoV:
  288.     GoSub MakeVectorFilter
  289.     InitDir$ = SourceDir$
  290.     InitFile$ = ""
  291.     Label$ = "Select an image file"
  292.     FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Image$)
  293.     If Image$ = "" Then Goto Wait_for_Input
  294.  
  295.     Text$ = 
  296. "Text that appears in the imagebox,
  297. would list known information about
  298. the selected image. This could be
  299. metadata embedded in the file
  300. e.g. in geoTIFF, or data from an
  301. external file or database access."
  302.  
  303.     ImageBox("ImageBox Title line",Image$, Text$,
  304.         "&Button#1", "&More Info",Btn)
  305.     FreeBitMap(Image$)
  306.  
  307.     Goto Wait_for_Input
  308.  
  309. BrowseDemoS:
  310.  
  311.     Goto Wait_for_Input
  312.  
  313. PrintFileDialog:
  314.     PrintFile("i:\v\v_image.ini",Res)
  315.     Goto Wait_for_Input
  316.  
  317. ToggleToolbar:
  318.     If ToolbarStatus = 0
  319.         DrawBitmap(0,0,Image4$)
  320.         If EditBarView = 1 Then DrawBitmap(364,0,Image3$)
  321.         ChangeMenuItem("&Toolbar",CHECK,Res)
  322.         ToolbarStatus = 1
  323.     Else
  324.         UseBrush(SOLID,192,192,192)
  325.         UsePen(SOLID,1,192,192,192)
  326.         WinGetClientRect("",cx1,cy1,cx2,cy2)
  327.         DrawRectangle(cx1,0,cx2,34)
  328.         ChangeMenuItem("&Toolbar",UNCHECK,Res)
  329.         ToolbarStatus = 0
  330.     Endif
  331.     Goto Wait_for_Input
  332.         
  333.     
  334. ToggleStatusBar:
  335.     If StatusBarView = 0
  336.         StatusWindow(ENABLE,BOTTOM,3,200,550,-1,0)
  337.         StatusBarView = 1
  338.         ChangeMenuItem("&Statusbar",CHECK,Res)
  339.     Else
  340.         StatusWindow(DISABLE,BOTTOM,3,200,550,-1,0)
  341.         StatusBarView = 0
  342.         ChangeMenuItem("&Statusbar",UNCHECK,Res)
  343.     Endif
  344.     Goto Wait_for_Input
  345.  
  346. ClearArea:
  347.     UseBrush(SOLID,255,255,255)
  348.     DrawRectangle(10,40,Pixels,Lines)
  349.     Goto Wait_for_Input
  350.  
  351. EditPenStyles:
  352.     ChooseColor(STD,PenR,PenG,PenB)
  353.     TextBox("Enter the pen size","Draw with Pen",PenSize$,Btn)
  354.     If Btn = 2 Then Goto Wait_for_Input
  355.     Val(PenSize$,PenSize,Res)
  356.     If Res = 0 Then PenSize = 1
  357.     Goto Wait_for_Input
  358.     
  359. DrawVectorLabels:
  360.     UseFont("Arial",7,13,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  361.     GoSub DrawVectorLabelFileContents
  362.     Goto Wait_for_Input
  363.  
  364. DrawVectors:  {read an IDRISI style .vec file}
  365.     Filter$ = "Vector Files(*.vec),*.vec)"
  366.     InitDir$ = SourceDir$
  367.     InitFile$ = "*.vec"
  368.     Label$ = "Select a Vector file to draw on current map."
  369.     FileGet(Filter$, InitFile$, InitDir$,Label$,CHANGEDIR,VectorFile$)
  370.     If VectorFile$ = "" Then Goto Wait_for_Input
  371.     GoSub DrawVectorFileContents
  372.     Goto Wait_for_Input
  373.  
  374. DrawVectorSet:
  375.     Filter$ = "Vector Files(*.vec),*.vec)"
  376.     InitDir$ = SourceDir$
  377.     InitFile$ = "*.vec"
  378.     Label$ = "Select a Vector file set to draw on current map."
  379.     FileGet(Filter$, InitFile$, InitDir$,Label$,CHANGEDIRMULTI,VectorFileSet$)
  380.     If VectorFileSet$ = "" Then Goto Wait_for_Input
  381.  
  382.     {path file file file ... make the set of filenames and draw the contents}
  383.     Instr(VectorFileSet$," ",spLoc)
  384.     If spLoc = 0 Then Goto Wait_for_Input
  385.  
  386.     LeftOf(VectorFileSet$,spLoc,Path$)   Path$ = Path$ +"\"
  387.     RightOf(VectorFileSet$,spLoc,VectorFileSet$)
  388.     Instr(VectorFileSet$," ",vspLoc)
  389. Loop:
  390.         If vspLoc = 0 Then Name$ = VectorFileSet$    VectorFileSet$ = ""
  391.         If vspLoc > 0 Then LeftOf(VectorFileSet$,vspLoc,Name$)
  392.         VectorFile$ = Path$ + Name$
  393.           RightOf(VectorFileSet$,vspLoc,VectorFileSet$)
  394.         GoSub DrawVectorFileContents
  395.         Len(VectorFileSet$,Long)
  396.         Instr(VectorFileSet$," ",vspLoc)
  397.  
  398.     If Long <> 0 Then Goto Loop
  399.     
  400.     Goto Wait_for_Input
  401.  
  402.  
  403.  
  404. DigitizeVectors:  {create an IDRISI style .vec file}
  405.     WaitInput(1)
  406.     Filter$ = "Vector Files(*.vec),*.vec"
  407.     InitDir$ = SourceDir$
  408.     InitFile$ = "project.vec"
  409.     Label$ = "Select a Vector filename to digitize from current map."
  410.     FileGet(Filter$, InitFile$, InitDir$,Label$,CHANGEDIR,VectorFile$)
  411.     If VectorFile$ = "" Then Goto Wait_for_Input
  412.     GoSub CreateVectorFile
  413.     Goto Wait_for_Input
  414.  
  415. DigitizeVectorsHelp:
  416.     MessageBox(OK,1,INFORMATION,
  417. "When you select this option, the cursor changes to a crosshair, and you
  418. are prompted for a VEC filename in which the points will be saved.
  419.  
  420. To digitize a point, click the Left mouse. The coords appear in the statusbar.
  421.  
  422. To check a point,  click Shift-Left mouse.  The coords appear in the statusbar.
  423.  
  424. To terminate the session, click the Right mouse. The number of points is
  425. reported in the statusbar, and the file is saved to disk.
  426.  
  427. Use the Draw Vector File menu item to plot the file on the displayed image.
  428.  
  429. In this sample file, the points are in client area coordinates. PiXCL 4.4 provides 
  430. integer math functions so coordinates can be scaled as needed. ",
  431.     "Digitizing Vector files from the application window.",Res)
  432.  
  433.     Goto Wait_for_Input
  434.  
  435.  
  436. DrawVectorFileContents: {subroutine}
  437.     FileGetSize(VectorFile$,FileSize)
  438.     FileRead_ASCII(VectorFile$,0,FileSize,Vectors$,Res)
  439.     Instr(Vectors$,Tab$,Loc)
  440.     Loc++ 
  441.     Instr(Vectors$,LF$,lfLoc)
  442.     Size = lfLoc - Loc
  443.     SubStr(Vectors$,Size,Loc,NumPts$) 
  444.     Val(NumPts$,NumPts,Res)
  445.  
  446.     UsePen(SOLID,PenSize,PenR,PenG,PenB)
  447.     ReDraw
  448.     WaitInput(1)
  449.     RightOf(Vectors$,lfLoc,Vectors$)
  450.     GoSub GetCoordPair
  451.     x1 = xx1    y1 = yy1
  452.     
  453.     For i=1 To NumPts
  454.         GoSub GetCoordPair
  455.         x2 = xx1   y2 = yy1
  456.         If x2 = 0 Then Break
  457.         DrawLine(x1,y1,x2,y2)
  458.         x1 = x2   y1 = y2
  459.     Next
  460.     Beep
  461.     Return
  462.  
  463. GetCoordPair:
  464.     Instr(Vectors$,LF$,lfLoc)    
  465.     If lfLoc = 0 Then xx1 = 0  yy1 = 0 Return
  466.     LeftOf(Vectors$,lfLoc,Pair$)
  467.     Instr(Pair$,Tab$,TabLoc)
  468.     LeftOf(Pair$,TabLoc,xx1$)  RightOf(Pair$,TabLoc,yy1$)
  469.     Val(xx1$,xx1,Res)   Val(yy1$,yy1,Res)
  470.     RightOf(Vectors$,lfLoc,Vectors$)
  471.  
  472.     Return
  473.  
  474.  
  475. CreateVectorFile: {subroutine}
  476.     Field$ = "100    4" + LF$
  477.     UseCursor(CROSS)
  478.     SetMouse(10,40,Pixels,Lines,GetCoords,x,y)
  479.     SetRightMouse(10,40,Pixels,Lines,EndGetCoords,x,y)
  480.     SetShftMouse(10,40,Pixels,Lines,TempCoords,x,y)
  481.     Counter = 0
  482.     WaitInput()
  483. GetCoords:
  484.     Str(X,X$)  Str(Y,Y$)
  485.     Coords$ = X$ + Tab$
  486.     Coords$ = Coords$ + Y$
  487.     StatusMsg$ = "Point:  " + X$
  488.     StatusMsg$ = StatusMsg$ +","
  489.     StatusMsg$ = StatusMsg$ + Y$
  490.     DrawStatusWintext(2,StatusMsg$)
  491.     Coords$ = Coords$ + LF$
  492.     Field$ = Field$ + Coords$
  493.     Counter++
  494.     WaitInput()
  495. TempCoords:
  496.     Str(X,X$)  Str(Y,Y$)
  497.     Coords$ = X$ + Tab$
  498.     Coords$ = Coords$ + Y$
  499.     StatusMsg$ = "Check Point:  " + X$
  500.     StatusMsg$ = StatusMsg$ +","
  501.     StatusMsg$ = StatusMsg$ + Y$
  502.     DrawStatusWintext(2,StatusMsg$)
  503.     WaitInput()
  504.  
  505. EndGetCoords:
  506.     SetMouse()
  507.     SetShftMouse()
  508.     SetRightMouse()
  509.     UseCursor(ARROW)
  510.     DrawStatusWintext(2,"End Digitization")
  511.     Ending$ = "0    0"
  512.     Field$ = Field$ + Ending$
  513.     Str(Counter,Counter$)
  514.     GoSub UpdatePointCount
  515.     Len(Field$,Long)
  516.     FileDelete(VectorFile$,Res)
  517.     FileWrite_ASCII(VectorFile$,0,Long,Field$,Res)
  518.     FreeVar(Field$)
  519.     WaitInput(400)
  520.     Msg$ = Counter$ + " points digitized."
  521.     DrawStatusWintext(2,Msg$)
  522.     WaitInput(400)
  523.     DrawStatusWintext(2,"")
  524.     ChangeToolbarBtn("Tools",15,ENABLED,Res)
  525.  
  526.     Return
  527.  
  528. UpdatePointCount: 
  529.     Instr(Field$,TAB$,Loc) Loc++
  530.     Instr(Field$,LF$,LocLF) Extract = LocLF - Loc
  531.     SubStr(Field$,Extract,Loc,Num$)
  532.     StrRepl(Field$,Num$,Counter$,Res)
  533.     Return
  534.  
  535. Test_TB:
  536.     Goto Wait_for_Input
  537.  
  538. MainFrameMenu:
  539.     DrawBackground
  540.     SetMenu("&File",IGNORE,
  541.         "&New",NewDemo,
  542.         "&Open Image",OpenImage,
  543.         "&Save Image",CloseImage,
  544.         "Save Image &As",CloseImage,
  545.         SEPARATOR,
  546.         "&New Workbench", NewDemo,
  547.         "Open &Workbench",OpenWBH,
  548.         "Save Work&bench",CloseWBH,
  549.         "Sa&ve Workbench As",CloseWBH,
  550.         SEPARATOR,        
  551.         "E&xit",Leave,
  552.         ENDPOPUP,
  553.         "&Edit",IGNORE,
  554.         "&Undo...Ctrl-Z",Demo,
  555.         "Cu&t...Ctrl-X",Demo,
  556.         "&Copy...Ctrl-C",Demo,
  557.         "&Paste...Ctrl-V",Demo,
  558.         "Clear...Del",Demo,
  559.         "&Select",Demo,
  560.         ENDPOPUP,
  561.         "&View",IGNORE,
  562.         "&Toolbar",ToggleToolbar,
  563.         "&Statusbar",ToggleStatusBar,
  564.         "&Current ColorTable",ColorTable,
  565.         "Set &Coord Space",Demo,
  566.         ENDPOPUP,
  567.         "&Help",IGNORE,
  568.         "&Contents",Demo,
  569.         "&Popup Context",PopupContext,
  570.         "&About",About,
  571.         "&Test Draw Polygon",Testing,    
  572.         ENDPOPUP)
  573.     
  574.  
  575.     Toolbar(    RAISED, 
  576.     STD_SMALL, 
  577.         NULL, NULL, SEPARATOR, "", Test_TB,
  578.  
  579.         NEW, ENABLED, STD, "FileNew", NewDemo,
  580.         OPEN, ENABLED, STD, "FileOpen", OpenImage,
  581.         SAVE, ENABLED, STD, "FileSave", CloseImage,
  582.  
  583.         NULL, NULL, SEPARATOR, "", Test_TB,
  584.         NULL, NULL, SEPARATOR, "", Test_TB,
  585.  
  586.         CUT,  ENABLED, CHECK_G, "Edit: Cut",Demo, 
  587.         COPY ,  ENABLED, CHECK_G, "Edit: Copy", Demo,
  588.         PASTE,  ENABLED, CHECK_G, "Edit: Paste",Demo, 
  589.         DELETE,  ENABLED, CHECK_G, "Edit: Delete", Demo, 
  590.         REPLACE, ENABLED,CHECK_G,"Edit: Replace",Demo,
  591.         REDO,  ENABLED, STD, "Redo", Demo, 
  592.         UNDO,  ENABLED, STD, "Undo", Demo, 
  593.         PRINT,  ENABLED, STD, "Print",Demo, 
  594.  
  595.         NULL, NULL, SEPARATOR, "", Test_TB,
  596.  
  597.         FIND,  ENABLED, STD, "Find", Demo, 
  598.         PROP, ENABLED, STD,"Properties",Demo,
  599.         PPREV,  ENABLED, STD, "Print Preview", Demo, 
  600.         SHOHLP,  ENABLED, STD, "Show Help",Demo) 
  601.  
  602.  
  603.         ToolbarStatus = 1
  604.         ChangeMenuItem("&Toolbar",CHECK,Res)
  605.         ChangeMenuItem("&Statusbar",CHECK,Res)
  606.         StatusWindow(ENABLE,BOTTOM,3,200,550,-1,0)
  607.         StatusBarView = 1
  608.         ToolWindowView = 0
  609.            EditBarView = 0
  610.     Return
  611.  
  612. ApplicationFrameMenu:
  613.     SetMenu("&File",IGNORE,
  614.         "&New",NewDemo,
  615.         "&Open Image",OpenImage,
  616.         "Save Image",CloseImage,
  617.         "Save Image As",CloseImage,
  618.         SEPARATOR,
  619.         "New Workbench",Demo,
  620.         "Open Workbench",OpenWBH,
  621.         "Save Workbench",CloseWBH,
  622.         "Save Workbench As",CloseWBH,
  623.         SEPARATOR,
  624.         "P&rinting Files",PrintFileDialog,
  625.         SEPARATOR,    
  626.         "E&xit",Leave,
  627.         ENDPOPUP,
  628.         "Edit",IGNORE,
  629.         "Undo",Demo,
  630.         "Cut",Demo,
  631.         "Copy...Ctrl-C",Demo,
  632.         "Paste...Ctrl-V",Demo,
  633.         "Clear",Demo,
  634.         "Select",Demo,
  635.         ENDPOPUP,
  636.         "View",IGNORE,
  637.         "&Toolbar",ToggleToolbar,
  638.         "&Statusbar",ToggleStatusBar,
  639.         "Current ColorTable",ColorTable,
  640.         "Set Coord Space",Demo,
  641.         ENDPOPUP,
  642.         "Overlays",IGNORE,
  643.         "Create New Overlay",Demo,
  644.         "Import Overlay",ImportOverlayDemo,
  645.         "Edit Overlay Color",PopupOpsEdit,
  646.         "Edit Pen Styles",EditPenStyles,
  647.         SEPARATOR,
  648.         "Draw Grid",DrawGrid,
  649.         SEPARATOR,
  650.         "Clear Image Area", ClearArea,
  651.         "Draw Vector Polygon File",DrawVectors,
  652.         "Draw Vector Polygon File Set",DrawVectorSet,
  653.         SEPARATOR,
  654.         "Digitize Vector Polygons",DigitizeVectors,
  655.         "Help Digitize Vectors",DigitizeVectorsHelp,
  656.         SEPARATOR,
  657.         "Draw Map Title",MapTitle,
  658.         SEPARATOR,
  659.         "Delete Overlay",DeleteOverlayDemo,
  660.         "Export Overlay",Demo,
  661.         ENDPOPUP,
  662.         "Tools",IGNORE,
  663.         "Preferences",ToolPreferences,
  664.         "Edit Tools",Demo,
  665.         ENDPOPUP,
  666.         "Map Browser",IGNORE,
  667.         "Raster maps",BrowseDemoR,
  668.         "Vector maps",BrowseDemoV,
  669.         "Sites Maplist",BrowseDemoS,
  670.         ENDPOPUP,
  671.         "&WorkBench Model",IGNORE,
  672.         "&Fire",FireWorkbench,
  673.         "F&lood",FloodWorkbench,
  674.         "&Transportation",TransportWorkbench,
  675.         ENDPOPUP,
  676.         "&Help",IGNORE,
  677.         "&Contents",Demo,
  678.         "&Popup Context",PopupContext,
  679.         "&About",About,
  680.         "&Test Draw Polygon",Testing,    
  681.         ENDPOPUP)
  682.         
  683.     Toolbar(    RAISED, 
  684.     STD_SMALL, 
  685.         NULL, NULL, SEPARATOR, "", Test_TB,
  686.  
  687.         NEW, ENABLED, STD, "FileNew", NewDemo,
  688.         OPEN, ENABLED, STD, "FileOpen", OpenImage,
  689.         SAVE, ENABLED, STD, "FileSave", CloseImage,
  690.  
  691.         NULL, NULL, SEPARATOR, "", Test_TB,
  692.         NULL, NULL, SEPARATOR, "", Test_TB,
  693.  
  694.         CUT,  ENABLED, CHECK_G, "Edit: Cut",Demo, 
  695.         COPY ,  ENABLED, CHECK_G, "Edit: Copy", Demo,
  696.         PASTE,  ENABLED, CHECK_G, "Edit: Paste",Demo, 
  697.         DELETE,  ENABLED, CHECK_G, "Edit: Delete", Demo, 
  698.         REPLACE, ENABLED,CHECK_G,"Edit: Replace",Demo,
  699.         REDO,  ENABLED, STD, "Redo", Demo, 
  700.         UNDO,  ENABLED, STD, "Undo", Demo, 
  701.         PRINT,  ENABLED, STD, "Print",Demo, 
  702.  
  703.         NULL, NULL, SEPARATOR, "", Test_TB,
  704.  
  705.         FIND,  ENABLED, STD, "Find", Demo, 
  706.         PROP, ENABLED, STD,"Properties",Demo,
  707.         PPREV,  ENABLED, STD, "Print Preview", Demo, 
  708.         SHOHLP,  ENABLED, STD, "Show Help",Demo) 
  709.  
  710.         StatusWindow(ENABLE,BOTTOM,3,200,550,-1,0)
  711.         ChangeMenuItem("&Toolbar",CHECK,Res)
  712.         ChangeMenuItem("&Statusbar",CHECK,Res)
  713.         ChangeMenuItem("Edit Overlay Color",UNCHECK,Res)
  714.         ToolbarView = 1
  715.         EditBarView = 1
  716.         StatusBarView = 1
  717.  
  718.         Return
  719.  
  720. Create_ToolWindow:
  721.     If ToolWindowView = 1 Then Return
  722.  
  723.     ToolWindow( 10, 50,112,324,POPUP,"Tools", 
  724.         RAISED, PXL_LARGE,              
  725.         ANNOT,  ENABLED, STD, "Draw Map Title", MapTitle,    
  726.         SQSELECT,  ENABLED, STD, "Select", Demo,
  727.         POLYSELECT,  ENABLED, STD, "PolySelect", Demo,
  728.         ERASE,  ENABLED, STD, "Erase",Demo,
  729.         OPENIMAGE,  ENABLED, STD, "Import Overlay Image",ImportOverlayDemo,
  730.         MIRROR,  ENABLED, STD, "Image Mirror", Demo,
  731.         FLIP,  ENABLED, STD, "Image Flip", Demo,
  732.         ROTATE,  ENABLED, STD, "Image Rotate",Demo,
  733.         SHOWRGB,  ENABLED, STD, "Show RGB", Demo,
  734.         PICKRGB,  ENABLED, CHECK, "Edit Overlay RGB", PopupOpsEdit,
  735.          NORMALIZE,  ENABLED, STD, "Normalize Image",Demo,
  736.         EQUALIZE,  ENABLED, STD, "Equalize Image",Demo,
  737.         NEGATIVE,  ENABLED, STD, "Negative Image",Demo,
  738.         IMAGEINFO,  ENABLED, STD, "ImageInfo",Demo,
  739.         FINGER,  ENABLED, CHECK, "Digitize Vectors",DigitizeVectors,
  740.         HAND,  ENABLED, STD, "Hand", Demo,
  741.         FLOOD,  ENABLED, STD, "Flood", Demo,
  742.         SPRAY,  ENABLED, STD, "Spray", Demo,
  743.         ZOOMUP,  ENABLED, STD, "Positive Zoom", Demo,
  744.         ZOOMDN,  ENABLED, STD, "Negative Zoom",Demo,
  745.         BRUSH,  ENABLED, STD, "Brush", Demo)
  746.  
  747.     ToolWindowView = 1
  748.     Return
  749.  
  750. MakeFilter:
  751.     Filter$ = "BMP Files(*.bmp),*.bmp,"
  752.     Filter$ = Filter$ + "JPEG Files(*.jpg),*.jpg,"
  753.     Filter$ = Filter$ + "PCD Files(*.pcd),*.pcd,"
  754.     Filter$ = Filter$ + "PCX Files(*.pcx),*.pcx,"
  755.     Filter$ = Filter$ + "PNG Files(*.png),*.png,"
  756.     Filter$ = Filter$ + "PPM Files(*.ppm),*.ppm,"
  757.     Filter$ = Filter$ + "RAS Files(*.ras),*.ras,"
  758.     Filter$ = Filter$ + "RLE Files(*.rle),*.rle,"
  759.     Filter$ = Filter$ + "TGA Files(*.tga),*.tga,"
  760.     Filter$ = Filter$ + "TIF Files(*.tif),*.tif"
  761.  
  762.     Return
  763.  
  764. MakeVectorFilter:
  765.     Filter$ = "DXF Files(*.dxf),*.dxf" {
  766.     Filter$ = Filter$ + "JPEG Files(*.jpg),*.jpg,"
  767.     Filter$ = Filter$ + "PCD Files(*.pcd),*.pcd,"
  768.     Filter$ = Filter$ + "PCX Files(*.pcx),*.pcx,"
  769.     Filter$ = Filter$ + "PNG Files(*.png),*.png,"
  770.     Filter$ = Filter$ + "PPM Files(*.ppm),*.ppm,"
  771.     Filter$ = Filter$ + "RAS Files(*.ras),*.ras,"
  772.     Filter$ = Filter$ + "RLE Files(*.rle),*.rle,"
  773.     Filter$ = Filter$ + "TGA Files(*.tga),*.tga,"
  774.     Filter$ = Filter$ + "TIF Files(*.tif),*.tif" }
  775.  
  776.     Return
  777.  
  778. CloseAllWorkbenches:
  779.     WinExist(WorkbenchTitle$,Res)
  780.     If Res = 1 Then WinClose(WorkbenchTitle$,Rxx)
  781.     If Res = 1 Then Goto CloseAllWorkbenches
  782.     DrawStatusWinText(1,"")
  783.     Return
  784.  
  785. ToolPreferences:
  786.     MessageBox(OK,1,INFORMATION,
  787. "Tool preferences for display views can be preset. e.g. a selection
  788. of toolbar buttons, available help files, paint and draw colors and
  789. similar. The specific needs will become more apparent during the 
  790. development process.",
  791.     "Setting View tool preferences",Res)
  792.     Goto Wait_for_Input
  793.  
  794.  
  795. Testing:
  796.     GoSub PolyLine
  797.     Goto Wait_for_Input
  798.  
  799.  
  800. PolyLine:
  801.     UseBrush(NULL,0,0,0)
  802.     UsePen(SOLID,2,255,0,0)
  803.     DrawPolygon(151,45,143,48,139,55,118,61,109,73,82,71,81,79,72,81,
  804. 66,94,55,89,24,100,12,110,
  805. 28,105,38,104,
  806. 48,101,51,121,
  807. 78,142,78,135,
  808. 93,134,103,128,
  809. 127,154,159,143,
  810. 174,156,171,166,
  811. 171,175,163,176,
  812. 161,189,147,190,
  813. 138,207,125,218,
  814. 131,229,194,207,
  815. 200,213,200,249,
  816. 185,249,159,279,
  817. 159,379,162,387)
  818.     Return
  819.  
  820. Initial_Help:
  821.     MessageBox(OK,1,INFORMATION,
  822. "This is a sample PiXCL application showing some of
  823. the capability of PiXCL 4.1. Not all menu items, toolbar or
  824. toolwindow buttons have any function coded. If not, a 
  825. messagebox appears informing you.
  826.  
  827. There are two sample images:  'furfcomp.bmp' and 
  828. 'furtclas.bmp' that are relevent. The first is derived
  829. from LANDSAT Thematic Mapper data, and should be 
  830. loaded as the background image. The second is the
  831. result of a classification i.e. it is an overlay image, loaded
  832. when you select an overlay menu or toolbar option.
  833.  
  834. There are also some sample VEC polygon files which 
  835. can be plotted either singly or as a set.",
  836.     "Notes on this sample PiXCL file.",Res)
  837.     Return